/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * NewJFrame.java
 *
 * Created on 30/09/2010, 12:39:55 PM
 */

package nz.ac.massey.doi_information_extractor.gui;

import java.awt.CardLayout;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

import javax.swing.DefaultComboBoxModel;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.LayoutStyle;
import javax.swing.UIManager;

import nz.ac.massey.doi_information_extractor.data.Author;
import nz.ac.massey.doi_information_extractor.data.Publication;


/**
 *
 * @author detyler
 */
public class GuiTwo extends AbstractGui implements KeyListener {

	public GuiTwo(ActionListener main) {
		super(main);
	}
	
	Publication currentPublication;
	// Variables declaration - do not modify
    private JTextField articleTitleField;
    private JLabel articleTitleLabel;
    private JList authorsJList;
    private JPanel bookCard;
    private JTextField bookDateField;
    private JLabel bookDateLabel;
    private JTextField bookEditionField;
    private JLabel bookEditionLabel;
    private JTextField bookEditorsField;
    private JLabel bookEditorsLabel;
    private JTextField bookIssnIsbnField;
    private JLabel bookIssnIsbnLabel;
    private JTextField bookPagesField;
    private JLabel bookPagesLabel;
    private JTextField bookTitleField;
    private JLabel bookTitleLabel;
    private JTextField bookUrlField;
    private JLabel bookUrlLabel;
    private JLabel characterCountLabel;
    private JPanel conferenceCard;
    private JTextField conferenceDateField;
    private JLabel conferenceDateLabel;
    private JTextField conferenceDatesField;
    private JLabel conferenceDatesLabel;
    private JTextField conferenceEditionField;
    private JLabel conferenceEditionLabel;
    private JTextField conferenceEditorsField;
    private JTextField conferenceIssnIsbnField;
    private JLabel conferenceIssnIsbnLabel;
    private JTextField conferenceLocationField;
    private JLabel conferenceLocationLabel;
    private JTextField conferencePagesField;
    private JLabel conferencePagesLabel;
    private JTextField conferenceUrlField;
    private JLabel conferenceUrlLabel;
    private JCheckBox confidentialBox;
    private JLabel descriptionLabel;
    private JTextField doiField;
    private JLabel editorsLabel;
    private JTextField issnIsbnField;
    private JScrollPane jScrollPane1;
    private JScrollPane jScrollPane2;
    private JSeparator jSeparator1;
    private JSeparator jSeparator2;
    private JTextArea descriptionArea;
    private JTextField keywordsField;
    private JPanel journalCard;
    private JTextField journalDateField;
    private JLabel journalDateLabel;
    private JTextField journalEditionField;
    private JLabel journalEditionLabel;
    private JLabel journalIssnIsbnLabel;
    private JTextField journalNumberField;
    private JLabel journalNumberLabel;
    private JTextField journalPagesField;
    private JLabel journalPagesLabel;
    private JTextField journalTitleField;
    private JTextField journalTitleField1;
    private JLabel journalTitleLabel;
    private JTextField journalUrlField;
    private JLabel journalUrlLabel;
    private JTextField journalVolumeField;
    private JLabel journalVolumeLabel;
    private JLabel keywordsLabel;

    private JTextField paperTitleField;
    private JLabel paperTitleLabel;
    private JTextField placePubishedField;
    private JLabel placePublishedLabel;
    private JTextField proceedingsField;
    private JLabel proceedingsLabel;
    private JRadioButton profCommRadioButton;
    private JComboBox publicationTypeDropDown;
    private JLabel publisherLabel;
    private JCheckBox qaBox;
    private JRadioButton researchRadioButton;
    private JTextField rimsIdField;
    private JLabel rimsIdLabel;

    private JButton setSubmitterButton;

    private JPanel swapPanel;
    private JLabel typeOfResearchLabel;
    private JComboBox researchProfCommDropDown;
    private JSeparator jSeparator3;
    // End of variables declaration
	

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    protected void initComponents() {

    	try {
			UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
		} catch(Exception e) {
		}
    	
		openButton = new javax.swing.JButton();
        saveButton = new javax.swing.JButton();
        outputButton = new javax.swing.JButton();
        settingsButton = new javax.swing.JButton();
        searchButton = new javax.swing.JButton();
        doiField = new javax.swing.JTextField();
        publicationTypeDropDown = new javax.swing.JComboBox();
        jSeparator1 = new javax.swing.JSeparator();
        rimsIdLabel = new javax.swing.JLabel();
        rimsIdField = new javax.swing.JTextField();
        typeOfResearchLabel = new javax.swing.JLabel();
        qaBox = new javax.swing.JCheckBox();
        confidentialBox = new javax.swing.JCheckBox();
        jSeparator2 = new javax.swing.JSeparator();
        jScrollPane1 = new javax.swing.JScrollPane();
        authorsJList = new javax.swing.JList();
        setAuthorButton = new javax.swing.JButton();
        setSubmitterButton = new javax.swing.JButton();
        swapPanel = new javax.swing.JPanel();
        bookCard = new javax.swing.JPanel();
        journalTitleField1 = new javax.swing.JTextField();
        bookTitleLabel = new javax.swing.JLabel();
        publisherLabel = new javax.swing.JLabel();
        bookTitleField = new javax.swing.JTextField();
        bookUrlLabel = new javax.swing.JLabel();
        bookUrlField = new javax.swing.JTextField();
        bookEditionLabel = new javax.swing.JLabel();
        bookEditionField = new javax.swing.JTextField();
        bookPagesField = new javax.swing.JTextField();
        bookPagesLabel = new javax.swing.JLabel();
        bookDateLabel = new javax.swing.JLabel();
        bookDateField = new javax.swing.JTextField();
        bookIssnIsbnLabel = new javax.swing.JLabel();
        bookIssnIsbnField = new javax.swing.JTextField();
        placePubishedField = new javax.swing.JTextField();
        placePublishedLabel = new javax.swing.JLabel();
        bookEditorsField = new javax.swing.JTextField();
        bookEditorsLabel = new javax.swing.JLabel();
        conferenceCard = new javax.swing.JPanel();
        paperTitleLabel = new javax.swing.JLabel();
        paperTitleField = new javax.swing.JTextField();
        proceedingsLabel = new javax.swing.JLabel();
        proceedingsField = new javax.swing.JTextField();
        conferenceLocationLabel = new javax.swing.JLabel();
        conferenceLocationField = new javax.swing.JTextField();
        conferenceDatesLabel = new javax.swing.JLabel();
        conferenceUrlLabel = new javax.swing.JLabel();
        editorsLabel = new javax.swing.JLabel();
        conferenceEditorsField = new javax.swing.JTextField();
        conferenceDatesField = new javax.swing.JTextField();
        conferenceUrlField = new javax.swing.JTextField();
        conferenceIssnIsbnField = new javax.swing.JTextField();
        conferenceIssnIsbnLabel = new javax.swing.JLabel();
        conferenceDateField = new javax.swing.JTextField();
        conferenceDateLabel = new javax.swing.JLabel();
        conferencePagesLabel = new javax.swing.JLabel();
        conferencePagesField = new javax.swing.JTextField();
        conferenceEditionField = new javax.swing.JTextField();
        conferenceEditionLabel = new javax.swing.JLabel();
        journalCard = new javax.swing.JPanel();
        journalTitleLabel = new javax.swing.JLabel();
        articleTitleLabel = new javax.swing.JLabel();
        journalUrlLabel = new javax.swing.JLabel();
        journalEditionLabel = new javax.swing.JLabel();
        journalTitleField = new javax.swing.JTextField();
        articleTitleField = new javax.swing.JTextField();
        journalUrlField = new javax.swing.JTextField();
        journalPagesLabel = new javax.swing.JLabel();
        journalDateLabel = new javax.swing.JLabel();
        journalEditionField = new javax.swing.JTextField();
        journalPagesField = new javax.swing.JTextField();
        journalDateField = new javax.swing.JTextField();
        journalIssnIsbnLabel = new javax.swing.JLabel();
        journalVolumeLabel = new javax.swing.JLabel();
        journalNumberLabel = new javax.swing.JLabel();
        issnIsbnField = new javax.swing.JTextField();
        journalVolumeField = new javax.swing.JTextField();
        journalNumberField = new javax.swing.JTextField();
        descriptionLabel = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        descriptionArea = new javax.swing.JTextArea();
        keywordsLabel = new javax.swing.JLabel();
        keywordsField = new javax.swing.JTextField();
        characterCountLabel = new javax.swing.JLabel();
        researchProfCommDropDown = new javax.swing.JComboBox();
        jSeparator3 = new javax.swing.JSeparator();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        openButton.setText("Open");

        saveButton.setText("Save");

        outputButton.setText("Output");

        settingsButton.setText("Settings");

        searchButton.setText("Search");

        publicationTypeDropDown.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Journal", "Book", "Conference" }));
        publicationTypeDropDown.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                String selectedType = (String)publicationTypeDropDown.getSelectedItem();
                if(currentPublication != null){
                    currentPublication.setPublicationType(selectedType);
                }
                setPublication(currentPublication);

                CardLayout c1 = (CardLayout) (swapPanel.getLayout());
                if(selectedType.equals("Journal")){
                    c1.show(swapPanel, "journalCard");
                }
                else if(selectedType.equals("Book")){
                    c1.show(swapPanel, "bookCard");
                }
                else if(selectedType.equals("Conference")){
                    c1.show(swapPanel, "conferenceCard");
                }
            }
        });

        rimsIdLabel.setText("RIMS ID:");

        typeOfResearchLabel.setText("Type of Research:");

        qaBox.setText("Quality Assured");

        confidentialBox.setText("Confidential");

        jScrollPane1.setViewportView(authorsJList);

        setAuthorButton.setText("Set Author");

        setSubmitterButton.setText("Set Submitter");

        swapPanel.setLayout(new java.awt.CardLayout());

        bookTitleLabel.setText("Book Title:");

        publisherLabel.setText("Article Title:");

        bookUrlLabel.setText("URL:");

        bookEditionLabel.setText("Edition:");

        bookPagesLabel.setText("Pages:");

        bookDateLabel.setText("Date:");

        bookIssnIsbnLabel.setText("ISSN/ISBN:");

        placePublishedLabel.setText("Place Published:");

        bookEditorsLabel.setText("Editors:");

        javax.swing.GroupLayout bookCardLayout = new javax.swing.GroupLayout(bookCard);
        bookCard.setLayout(bookCardLayout);
        bookCardLayout.setHorizontalGroup(
            bookCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(bookCardLayout.createSequentialGroup()
                .addGroup(bookCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(placePublishedLabel)
                    .addComponent(bookTitleLabel)
                    .addComponent(publisherLabel)
                    .addComponent(bookUrlLabel)
                    .addComponent(bookEditorsLabel)
                    .addComponent(bookEditionLabel)
                    .addComponent(bookIssnIsbnLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(bookCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(bookCardLayout.createSequentialGroup()
                        .addGroup(bookCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(bookEditionField, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(bookIssnIsbnField, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(bookCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(bookPagesLabel)
                            .addComponent(bookDateLabel))
                        .addGap(18, 18, 18)
                        .addGroup(bookCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(bookDateField)
                            .addComponent(bookPagesField, javax.swing.GroupLayout.DEFAULT_SIZE, 98, Short.MAX_VALUE)))
                    .addComponent(bookTitleField, javax.swing.GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
                    .addComponent(journalTitleField1, javax.swing.GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
                    .addComponent(placePubishedField, javax.swing.GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
                    .addComponent(bookUrlField, javax.swing.GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
                    .addComponent(bookEditorsField, javax.swing.GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE))
                .addContainerGap())
        );
        bookCardLayout.setVerticalGroup(
            bookCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(bookCardLayout.createSequentialGroup()
                .addGroup(bookCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(bookTitleLabel)
                    .addComponent(journalTitleField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(bookCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(publisherLabel)
                    .addComponent(bookTitleField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(bookCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(placePublishedLabel)
                    .addComponent(placePubishedField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(bookCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(bookUrlLabel)
                    .addComponent(bookUrlField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(bookCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(bookEditorsLabel)
                    .addComponent(bookEditorsField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(bookCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(bookEditionLabel)
                    .addComponent(bookEditionField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(bookPagesLabel)
                    .addComponent(bookPagesField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(bookCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(bookIssnIsbnLabel)
                    .addComponent(bookIssnIsbnField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(bookDateLabel)
                    .addComponent(bookDateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        swapPanel.add(bookCard, "bookCard");

        paperTitleLabel.setText("Paper Title:");

        proceedingsLabel.setText("Proceedings Title:");

        conferenceLocationLabel.setText("Conference Location:");

        conferenceDatesLabel.setText("Conference Dates:");

        conferenceUrlLabel.setText("URL:");

        editorsLabel.setText("Editors:");

        conferenceIssnIsbnLabel.setText("ISSN/ISBN:");

        conferenceDateLabel.setText("Date:");

        conferencePagesLabel.setText("Pages:");

        conferenceEditionLabel.setText("Edition:");

        javax.swing.GroupLayout conferenceCardLayout = new javax.swing.GroupLayout(conferenceCard);
        conferenceCard.setLayout(conferenceCardLayout);
        conferenceCardLayout.setHorizontalGroup(
            conferenceCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(conferenceCardLayout.createSequentialGroup()
                .addGroup(conferenceCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(paperTitleLabel)
                    .addComponent(proceedingsLabel)
                    .addComponent(conferenceLocationLabel)
                    .addComponent(conferenceDatesLabel)
                    .addComponent(conferenceUrlLabel)
                    .addComponent(editorsLabel)
                    .addComponent(conferenceEditionLabel)
                    .addComponent(conferenceIssnIsbnLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(conferenceCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(conferenceCardLayout.createSequentialGroup()
                        .addGroup(conferenceCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(conferenceIssnIsbnField, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(conferenceEditionField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 104, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addGroup(conferenceCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(conferencePagesLabel)
                            .addComponent(conferenceDateLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(conferenceCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(conferenceDateField)
                            .addComponent(conferencePagesField, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(paperTitleField, javax.swing.GroupLayout.DEFAULT_SIZE, 499, Short.MAX_VALUE)
                    .addComponent(proceedingsField, javax.swing.GroupLayout.DEFAULT_SIZE, 499, Short.MAX_VALUE)
                    .addComponent(conferenceLocationField, javax.swing.GroupLayout.DEFAULT_SIZE, 499, Short.MAX_VALUE)
                    .addComponent(conferenceDatesField, javax.swing.GroupLayout.DEFAULT_SIZE, 499, Short.MAX_VALUE)
                    .addComponent(conferenceUrlField, javax.swing.GroupLayout.DEFAULT_SIZE, 499, Short.MAX_VALUE)
                    .addComponent(conferenceEditorsField, javax.swing.GroupLayout.DEFAULT_SIZE, 499, Short.MAX_VALUE))
                .addContainerGap())
        );
        conferenceCardLayout.setVerticalGroup(
            conferenceCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(conferenceCardLayout.createSequentialGroup()
                .addGroup(conferenceCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(paperTitleLabel)
                    .addComponent(paperTitleField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(conferenceCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(proceedingsLabel)
                    .addComponent(proceedingsField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(conferenceCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(conferenceLocationLabel)
                    .addComponent(conferenceLocationField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(conferenceCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(conferenceDatesLabel)
                    .addComponent(conferenceDatesField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(conferenceCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(conferenceUrlLabel)
                    .addComponent(conferenceUrlField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(conferenceCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(editorsLabel)
                    .addComponent(conferenceEditorsField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(conferenceCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(conferenceCardLayout.createSequentialGroup()
                        .addGroup(conferenceCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(conferenceEditionLabel)
                            .addComponent(conferenceEditionField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(conferencePagesLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(conferenceCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(conferenceIssnIsbnLabel)
                            .addComponent(conferenceIssnIsbnField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(conferenceDateLabel)))
                    .addGroup(conferenceCardLayout.createSequentialGroup()
                        .addComponent(conferencePagesField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(conferenceDateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        swapPanel.add(conferenceCard, "conferenceCard");

        journalTitleLabel.setText("Journal Title:");

        articleTitleLabel.setText("Article Title:");

        journalUrlLabel.setText("URL:");

        journalEditionLabel.setText("Edition:");

        journalPagesLabel.setText("Pages:");

        journalDateLabel.setText("Date:");

        journalIssnIsbnLabel.setText("ISSN/ISBN:");

        journalVolumeLabel.setText("Volume:");

        journalNumberLabel.setText("Number:");

        javax.swing.GroupLayout journalCardLayout = new javax.swing.GroupLayout(journalCard);
        journalCard.setLayout(journalCardLayout);
        journalCardLayout.setHorizontalGroup(
            journalCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(journalCardLayout.createSequentialGroup()
                .addGroup(journalCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(journalCardLayout.createSequentialGroup()
                        .addGroup(journalCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(journalCardLayout.createSequentialGroup()
                                .addGap(2, 2, 2)
                                .addComponent(journalIssnIsbnLabel))
                            .addComponent(journalEditionLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(journalCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(journalEditionField, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(issnIsbnField))
                        .addGap(10, 10, 10)
                        .addGroup(journalCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(journalPagesLabel)
                            .addComponent(journalVolumeLabel))
                        .addGap(8, 8, 8)
                        .addGroup(journalCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(journalVolumeField, javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE)
                            .addComponent(journalPagesField, javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(journalCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, journalCardLayout.createSequentialGroup()
                                .addComponent(journalNumberLabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(journalNumberField, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, journalCardLayout.createSequentialGroup()
                                .addComponent(journalDateLabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(journalDateField, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(journalCardLayout.createSequentialGroup()
                        .addGroup(journalCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(articleTitleLabel)
                            .addComponent(journalUrlLabel)
                            .addComponent(journalTitleLabel))
                        .addGap(5, 5, 5)
                        .addGroup(journalCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(journalTitleField, javax.swing.GroupLayout.DEFAULT_SIZE, 548, Short.MAX_VALUE)
                            .addComponent(journalUrlField, javax.swing.GroupLayout.DEFAULT_SIZE, 548, Short.MAX_VALUE)
                            .addComponent(articleTitleField, javax.swing.GroupLayout.DEFAULT_SIZE, 548, Short.MAX_VALUE))))
                .addContainerGap())
        );
        journalCardLayout.setVerticalGroup(
            journalCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(journalCardLayout.createSequentialGroup()
                .addGroup(journalCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(journalTitleLabel)
                    .addComponent(journalTitleField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(journalCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(articleTitleLabel)
                    .addComponent(articleTitleField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(journalCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(journalUrlLabel)
                    .addComponent(journalUrlField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(journalCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(journalCardLayout.createSequentialGroup()
                        .addGroup(journalCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(journalEditionLabel)
                            .addComponent(journalEditionField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(journalDateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(journalDateLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(journalCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(issnIsbnField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(journalNumberField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(journalNumberLabel)
                            .addComponent(journalIssnIsbnLabel)))
                    .addGroup(journalCardLayout.createSequentialGroup()
                        .addGroup(journalCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(journalPagesLabel)
                            .addComponent(journalPagesField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(journalCardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(journalVolumeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(journalVolumeLabel))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        swapPanel.add(journalCard, "journalCard");

        descriptionLabel.setText("Description:");

        descriptionArea.setColumns(20);
        descriptionArea.setRows(5);
        jScrollPane2.setViewportView(descriptionArea);
        descriptionArea.addKeyListener(this);

        keywordsLabel.setText("Keywords:");

        characterCountLabel.setText("0");

        researchProfCommDropDown.setModel(new DefaultComboBoxModel(new String[] { "Research", "Professional/Community" }));

        GroupLayout layout = new GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                    .addComponent(swapPanel, GroupLayout.DEFAULT_SIZE, 625, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
                            .addComponent(jSeparator3, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 615, Short.MAX_VALUE)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(openButton, GroupLayout.PREFERRED_SIZE, 151, GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(saveButton, GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE)
                                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(outputButton, GroupLayout.PREFERRED_SIZE, 148, GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(settingsButton, GroupLayout.PREFERRED_SIZE, 153, GroupLayout.PREFERRED_SIZE))
                            .addComponent(jSeparator2, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 615, Short.MAX_VALUE)
                            .addGroup(GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(rimsIdLabel)
                                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(rimsIdField, GroupLayout.PREFERRED_SIZE, 278, GroupLayout.PREFERRED_SIZE))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(typeOfResearchLabel)
                                        .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(researchProfCommDropDown, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                                .addGap(26, 26, 26)
                                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                                    .addComponent(qaBox)
                                    .addComponent(confidentialBox)))
                            .addComponent(jSeparator1, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 615, Short.MAX_VALUE)
                            .addGroup(GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addComponent(doiField, GroupLayout.PREFERRED_SIZE, 348, GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(publicationTypeDropDown, 0, 144, Short.MAX_VALUE)
                                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(searchButton, GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
                                        .addComponent(characterCountLabel)
                                        .addComponent(descriptionLabel))
                                    .addComponent(keywordsLabel))
                                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                                    .addComponent(keywordsField, GroupLayout.DEFAULT_SIZE, 548, Short.MAX_VALUE)
                                    .addComponent(jScrollPane2, GroupLayout.DEFAULT_SIZE, 548, Short.MAX_VALUE)))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                                    .addComponent(setSubmitterButton, GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE)
                                    .addComponent(setAuthorButton, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE))
                                .addGap(18, 18, 18)
                                .addComponent(jScrollPane1, GroupLayout.PREFERRED_SIZE, 498, GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap())))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                    .addComponent(openButton)
                    .addComponent(settingsButton)
                    .addComponent(outputButton)
                    .addComponent(saveButton))
                .addGap(11, 11, 11)
                .addComponent(jSeparator3, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                    .addComponent(doiField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .addComponent(searchButton)
                    .addComponent(publicationTypeDropDown, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jSeparator1, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                    .addComponent(rimsIdLabel)
                    .addComponent(rimsIdField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .addComponent(qaBox))
                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                    .addComponent(typeOfResearchLabel)
                    .addComponent(confidentialBox)
                    .addComponent(researchProfCommDropDown, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jSeparator2, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(setAuthorButton)
                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(setSubmitterButton))
                    .addComponent(jScrollPane1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(swapPanel, GroupLayout.PREFERRED_SIZE, 239, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(descriptionLabel)
                        .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(characterCountLabel))
                    .addComponent(jScrollPane2, GroupLayout.PREFERRED_SIZE, 76, GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                    .addComponent(keywordsField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .addComponent(keywordsLabel))
                .addContainerGap(15, Short.MAX_VALUE))
        );

        this.setTitle("DOI Information Extractor");
        pack();
        this.setVisible(true);
    }// </editor-fold>


	@Override
	public String getDoi() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Publication getPublication() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Author getSelectedAuthor() {
		// TODO Auto-generated method stub
		return null;
	}


	@Override
	public void setPublication(Publication publication) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void setSelectedAuthor(Author author) {
		// TODO Auto-generated method stub
		
	}

	/**
	 *
	 */
	@Override
	public void keyPressed(KeyEvent e) {
		currentPublication.setDescription(descriptionArea.getText());
		setCharacterCountLabel();
	}

	/**
	 *
	 */
	@Override
	public void keyReleased(KeyEvent e) {
		currentPublication.setDescription(descriptionArea.getText());
		setCharacterCountLabel();
	}

	/**
	 *
	 */
	@Override
	public void keyTyped(KeyEvent e) {
		currentPublication.setDescription(descriptionArea.getText());
		setCharacterCountLabel();
	}

	/**
	 *
	 */
	private void setCharacterCountLabel(){
		characterCountLabel.setText(Integer.toString(currentPublication.getDescription().length()));
	}


}
